package com.peanut.service.Impl;

import com.peanut.dao.UserDao;
import com.peanut.model.User;
import com.peanut.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public User getUserById(Integer id) {
        return userDao.getUserById(id);
    }

    @Override
    public User addUser(User user) {
        userDao.addUser(user);
        return user;
    }

    @Override
    public User delById(Integer id) {
        return userDao.delById(id);
    }

    @Override
    public User update(User user) {
        return userDao.update(user);
    }

    @Override
    public List<User> list() {
        return userDao.list();
    }
}
